package fr.univ.surveyonline.question;

import org.junit.rules.ExpectedException;

import org.junit.*;

import static org.junit.Assert.*;

public class TestDescription {

	// TESTED OBJECT
	private Description description;
	
	@Rule
	public ExpectedException thrown = ExpectedException.none();
	
	@Before
	public void setUp() {
		this.description = new Description();
	}
	
	@Test
	public void testSetText_01_1() {
		thrown.expect(IllegalArgumentException.class);
		this.description.setText(null);
	}
	
	@Test
	public void testSetText_01_2() {
		thrown.expect(IllegalArgumentException.class);
		this.description.setText("");
	}
	
	@Test
	public void testSetText_02_1() {
		String desc = "premire description";
		this.description.setText(desc);
		assertEquals(desc, this.description.getText());
	}
	
	@Test
	public void testSetText_02_2() {
		String desc = "deuxieme description";
		this.description.setText(desc);
		assertEquals(desc, this.description.getText());
	}
	
	@Test
	public void testSetText_02_3() {
		String desc = "troisieme description";
		this.description.setText(desc);
		assertEquals(desc, this.description.getText());
	}

	
	
}
